<?php
namespace app\model;
use app\BaseModel;
use think\model\concern\SoftDelete;

class Agency extends BaseModel
{

    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $defaultSoftDelete = '0000-00-00 00:00:00';
    protected $hidden = ['update_time','delete_time','sort','status'];



    public function searchAuditStatusAttr($query,$value,$data){
        if(!empty($value)){
            $query->where('audit_status','=',$value);
        }
    }



    protected function setAuditStatusAttr($value,$data){ //当前字段的修改器
         $status = [1=>'未读',2=>'已读'];
         $this->set('audit_title',$status[$data['audit_status']]);
         return $value;
    }





}